<div class="contents">
  <ol class="breadcrumb">
    <li><a href="#/index/panel">首页</a></li>
    <!--<li><a href="#/ad/list">广告管理</a></li>-->
    <li class="active">{{addOrUpdate}}</li>
  </ol>
  <form class="form-horizontal" role="form" name="form" ng-submit="save()" novalidate>
    <div ng-if="t!=10" class="form-group" ng-class="{'has-error':form.sort.$invalid}">
      <label class="col-sm-2 control-label">优先级</label>
      <div class="col-sm-5">
        <select class="form-control" name="sort" ng-model="msg.sort" required="required">
          <option value="1">最高</option>
          <option value="2">适中</option>
        </select>
      </div>
    </div>
    <div ng-if="t!=10" class="form-group" ng-class="{'has-error':form.type.$invalid}">
      <label for="advertTitleInput" class="col-sm-2 control-label">资讯类型</label>
      <div class="col-sm-5" >
        <select class="form-control" name="type" ng-model="msg.type" ng-options="m.value as m.text for m in dictMap.adMsgTypeModel" required="required">
        </select>
      </div>
    </div>
    <div ng-if="t!=10" class="form-group" ng-class="{'has-error':form.title.$invalid}">
      <label class="col-sm-2 control-label"><span class="required">*</span>标题</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="标题" name="title" ng-model="msg.title" required="required">
      </div>
    </div>
    <div  ng-if="t!=10" class="form-group" >
      <label class="col-sm-2 control-label"><span class="required">*</span>来源</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="来源" name="source" ng-model="msg.source" >
      </div>
    </div>
    <div ng-if="t==10&&!msg.id" class="form-group" ng-class="{'has-error':form.publicDate.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        早报时间
      </label>
      <div class="col-sm-5">
        <input type="date" class="form-control" autocomplete="off" value="" name="publicDate" ng-model="msg.publicDate" required="required" placeholder="起售时间,格式如2014-09-01" ng-pattern="/^\d{4}-\d{2}-\d{2}$/">
      </div>
    </div>
    <div ng-if="t==10" class="form-group" ng-class="{'has-error':form.topContent.$invalid}">
      <label class="col-sm-2 control-label"><span class="required">*</span>今日热点</label>
      <div class="col-sm-7">
         <div class="ueditor" config="config" ready="ready" ng-model="msg.topContent" style="height:300px;" required></div>
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.contents.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        {{t==10?"资讯快览":"正文"}}
      </label>
      <div class="col-sm-7">
        <div class="ueditor" config="config" ready="ready" ng-model="msg.contents" style="height:300px;" required></div>
      </div>
    </div>
    <div ng-if="t==10" class="form-group" ng-class="{'has-error':form.title.$invalid}">
      <label class="col-sm-2 control-label"><span class="required">*</span>微信分享标题</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="标题" name="title" ng-model="msg.title" required="required">
      </div>
    </div>
    <div  ng-if="t==10" class="form-group" ng-class="{'has-error':form.source.$invalid}">
       <label class="col-sm-2 control-label"><span class="required">*</span>微信分享描述(64字内)</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="描述(64字内)" name="source" required="required" ng-model="msg.source" >
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.pic.$invalid}">
      <label class="col-sm-2 control-label">{{t==10?"微信分享":""}}图片地址</label>
      <div class="col-sm-5">
        <input  ng-if="t!=10" type="text" class="form-control" placeholder="图片地址" name="pic" ng-model="msg.filePath">
        <input  ng-if="t==10" type="text" class="form-control" placeholder="图片地址" name="pic" required="required" ng-model="msg.filePath">
        <div class="btn btn-primary add-pic-btn">上传图片</div>
      </div>

    </div>

    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-5">
        <button type="submit" class="btn btn-default">提交</button>
      </div>
    </div>
  </form>
</div>
<div load-script src="'/static/jquery.jUploader-1.01.js?5'" call-back="" charset="utf-8" ></div>